<?
    /* -*- Mode: PHP5; tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- */

    /*********************************************************
    *            --== InArch ==--
    *
    * @author Kulikov Alexey <a.kulikov@gmail.com>
    * @version n/a
    * @since 30.04.2005
    * @copyright essentialmind.com 2005
    *
    *********************************************************/
    
    /***
    * Class safeHTMLwrap
    ****
    * This is a wrapper for a third party library SAFEHTML, which
    * closes all unclosed tags in documents, et cetera.
    ****
    * @package service
    * @author A Kulikov <a.kulikov@gmail.com>
    * @version n/a
    * @since 30.04.2005
    * @copyright essentialmind.com 2005
    ***/
    class safeHTMLwrap{
        
        /**
         * Parser for safeHTML documents
         *
         * @var safehtml
         */
        private $parser;
        
        /**
         * El Constructor
         *
         */
        public function __construct(){
            //pointer to XML_HTMLSAX3 parser
            define('XML_HTMLSAX3', INA_ROOT.'lib'.DIRECTORY_SEPARATOR.'safehtml'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR);
            
            //get the libraries
            require_once INA_ROOT.'lib'.DIRECTORY_SEPARATOR.'safehtml'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'safehtml.php';   
            
            //create the parser
            $this->parser = &new safehtml();
        }
        
        
        /**
         * This function places a call to the parser, which will create safehtml out
         * of whatever inputs it gets
         *
         * @param string $data
         * @return string
         */
        public function parse($data){
            return $this->parser->parse($data);
        }
    }
?>